#include <stdio.h>
#include <math.h>
int main()
{
	while (1)
	{
		int icard[3];
		char ccard[3];
		int x,i,total,Anum;
		total=0;
		Anum=0;
		int A;
		for (i=0;i<3;i++)
		{
         printf("Now we are entering the %i card.\n",i+1);
		 printf("If it belongs to 1 to 10, please enter 1.If it belongs to J,Q,K,A ,please enter 2\n");
		 scanf("%i",&x);
		 printf("Please enter the %i card.\n",i+1);
		 if (x==1)
		 {
		  scanf("%i",&icard[i]);
		  total+=icard[i];
		 }
		 if (x==2)
		 {
		  scanf("%c",&ccard[i]);
		  if (ccard[i]='A')
		  {
			  total+=11;
			  Anum+=1;
		  }
		  else
		  total+=10;
		  
		 }
        x=0;
		}
	if (total>21)
	{
		total=total-10*Anum;
	}
	printf("total=%i\n\n\n",total);
	printf("start next round\n");
	}
	return 0;
}